'use strict';

// //用数组实现栈
class Stack{
  constructor()
  {
    this.items = [];
  }

  push(elelment)
  {
    this.items.push(elelment);
  }

  pop()
  {
    return this.items.pop();
  }

  peek()
  {
    return this.items[this.items.length-1];
  }

  isEmpty()
  {
    return this.items.length === 0;
  }

  clear(){
    this.items = [];
  }
}

const stack = new Stack();
console.log(stack.isEmpty());




